//
//  IORNNTrainer.h
//  iornn-parser-c
//
//  Created by Phong Le on 25/12/14.
//  Copyright (c) 2014 Phong Le. All rights reserved.
//

#ifndef IORNNTrainer_h
#define IORNNTrainer_h

#include "Param.h"
#include "Matrix.h"
#include "Utils.h"
#include <time.h>
#include <sys/time.h>
#include <unordered_set>
#include <iostream>
#include <iomanip>
#include "CGRNN.h"
#include "Corpus.h"

using namespace std;

class CGRNNTrainer {
public:
    
    Param *paramVarience;
    vector<int> nEvals;
    
    CGRNNTrainer() { paramVarience = NULL;}
    virtual ~CGRNNTrainer() {};
    
    void adagrad(CGRNN* net, Param* grad, unordered_set<int>& tWords, unordered_set<int>& tPath);
    
    void train(CGRNN* net, Container* tb, Container* devTb);

    virtual void eval(CGRNN* net, Container* devTb);
};

#endif
